<%@ page language="java" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="s" uri="http://www.springframework.org/tags"%>
<%@ page isELIgnored="false"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>

<link rel="stylesheet"
	href="<s:url value="/resources"/>/css/innerstyle.css" type="text/css" />
<link rel="stylesheet" type="text/css" media="screen"
	href="<s:url value="/resources"/>/css/custom-theme/jquery-ui.custom.min.css" />
<!--<script type='text/javascript' src='<s:url value="/resources"/>//glqt/dwr/util.js'></script>
<script type='text/javascript' src='<s:url value="/resources"/>//glqt/dwr/engine.js'></script>
<script type='text/javascript' src='<s:url value="/resources"/>//glqt/dwr/interface/htdwr.js'></script>
<script type='text/javascript' src='<s:url value="/resources"/>//glqt/dwr/interface/jydz.js'></script>-->
<script type="text/javascript"
	src="<s:url value="/resources"/>/js/jquery-1.7.2.min.js"></script>
<script type="text/javascript"
	src="<s:url value="/resources"/>/js/jquery-ui.custom.min.js"></script>
<script type="text/javascript"
	src="<s:url value="/resources"/>/js/i18n/jquery.ui.datepicker-zh-CN.js"></script>
<script type="text/javascript"
	src="<s:url value="/resources"/>/js/jquery.form.js"></script>
<script type="text/javascript"
	src="<s:url value="/resources"/>/js/json2.js"></script>
<script type="text/javascript"
	src="<s:url value="/resources"/>/js/jquery.validate.min.js"></script>
<script type="text/javascript"
	src="<s:url value="/resources"/>/js/messages_zh.js"></script>
<script type="text/javascript"
	src="<s:url value="/resources"/>/js/htinfo.js"></script>
<style type="text/css">
textarea{
font-size:12px;
}
#tab {
	width: 99%;
	border: #F4F4F4 solid 4px;
	padding: 0 2px 3px 2px;
	margin: 0;
	float: left;
}

#tab h1 {
	display: block;
	width: 95%;
	height: 45px;
	float: center;
	font-size:24;
	text-align: center;
	padding-top: 5px;
}

#tab h1 span {
	width: 250px;
	font: bold 26px/55px Arial, Helvetica, sans-serif;
	color: #fff;
	background-color: #fff;
	display: block;
}

.textbox {
	width: 90px;
	border: #000 1px solid;
}

.textboxs {
	width: 70px;
	border: #000 1px solid;
}

.textboxs1 {
	width: 70px;
	border: #000 1px solid;
	background-color: #ddd;
}

.longtextbox {
	width: 180px;
	border: #000 1px solid;
}

.longtextbox1 {
	width: 180px;
	border: #000 1px solid;
	background-color: #ddd;
}

.shorttextbox {
	width: 50px;
	border: #000 1px solid;
}

.shorttextbox1 {
	width: 50px;
	border: #000 1px solid;
	background-color: #ddd;
}

.textarea {
	overflow: auto;
	border: #000 1px solid;
}

.textarea1 {
	overflow: auto;
	border: #000 1px solid;
	background-color: #ddd;
}

.select div {
	border: 1px solid #000;
	float: left;
}

label {
	display: block;
}

fieldset {
	padding: 0;
	border: 0;
	margin-top: 25px;
}

label.error {
	color: red; /*错误信息的颜色*/
}

input.error {
	border: 1px dotted red; /*输入错误的输入框的边框样式*/
}
</style>
<script type='text/javascript'>

    function clickPzgg() {

        	var obj = new Object();
            obj.name="质量指标";

            var MyArgs=window.showModalDialog('<s:url value="/"/>/common/ZBSelect', obj,"dialogWidth:660px;dialogHeight:440px");

            if(MyArgs[0].toString()=="-1"){
            	if(MyArgs[1].toString()=="-1"&&MyArgs[2].toString()=="-1"){
            		$("#pinzgg").val(""); 
            		$("#meiz").val(""); 
            		$("#pinz").val(""); 
            		alert("请选择煤种和品种")
            	}else if(MyArgs[1].toString()!="-1"&&MyArgs[2].toString()!="-1"){
            		$("#pinzgg").val(MyArgs[3].toString()+"."+MyArgs[4].toString()); 
            		$("#meiz").val(MyArgs[1].toString()); 
            		$("#pinz").val(MyArgs[2].toString()); 
            	}else if(MyArgs[1].toString()!="-1"&&MyArgs[2].toString()=="-1"){
            		$("#pinzgg").val(MyArgs[3].toString());
            		$("#meiz").val(MyArgs[1].toString()); 
            		$("#pinz").val("");
            	}else if(MyArgs[1].toString()=="-1"&&MyArgs[2].toString()!="-1"){
            		$("#pinzgg").val(MyArgs[4].toString());
            		$("#meiz").val(""); 
            		$("#pinz").val(MyArgs[2].toString());
            	}
            	$("#pinp").val("-1"); 	
            }else{
            	 if(MyArgs[3].toString()!=null&&MyArgs[4].toString()==null)
                 {
                 	$("#pinzgg").val(MyArgs[3].toString()); 
                 	$("#meiz").val(MyArgs[1].toString()); 
            		$("#pinz").val(""); 
                 }
                 if(MyArgs[3].toString()==null&&MyArgs[4].toString()!=null)
                 {
                 	$("#pinzgg").val(MyArgs[4].toString()); 
                 	$("#meiz").val(""); 
            		$("#pinz").val(MyArgs[2].toString()); 
                 }
                 if(MyArgs[3].toString()!=null&&MyArgs[4].toString()!=null)
                 {
                 	$("#pinzgg").val(MyArgs[3].toString()+"."+MyArgs[4].toString()); 
                 	$("#meiz").val(MyArgs[1].toString()); 
            		$("#pinz").val(MyArgs[2].toString()); 
                 }
                 $("#pinp").val(MyArgs[0].toString()); 
            }
            var zlzb=MyArgs[5].toString();
            var zlzbs=MyArgs[6].toString();
            
            $("#pinzmc").val(MyArgs[4].toString());
            $("#meizmc").val(MyArgs[3].toString());
            $("#pinpid").val(MyArgs[0].toString()); 
            
            $("#zlzb").val(zlzb);
            $("#zlzbs").val("["+zlzbs+"]");

    }
	

	function changeTabForCmr(val) {
		var url = "<s:url value="/"/>/common/changeCmr?qiyid="+ val;
		$.get(url, function(data) {
			var json = eval('(' + data + ')');
			$("#qiymc").val(json[0].danwmc);
			$("#chumdwdz").val(json[0].zhus);
			$("#chumdwnsrdjh").val(json[0].nasrdjh);
			
			$("#chumdwfddbr").val(json[0].faddbr);
			$("#chumdwwtdlr").val(json[0].weitdlr);
			$("#chumdwdh").val(json[0].dianh);
			$("#chumdwcz").val(json[0].chuanz);
			$("#chumdwyzbm").val(json[0].youzbm);
			$("#chumdwkhyh").val(json[0].kaihyh);
			$("#chumdwzh").val(json[0].yinhzh);
			
			//$("#baoddw").val(json[0].danwmc);
			$("#cmrlx").val('1');
		});

	}


	function changeTabForHttk(vvalue) {
		var ismy = '';
		var url = "findHttkInfoByMobbm?mobbm=" + vvalue;
		$
				.post(
						url,
						function(data) {
							var json = eval('(' + data + ')');
							//alert(data);
							$("#httk").children().remove();
							var dtable = document.getElementById("httk");
							for ( var i = 0; i < json.length; i++) {
								jydzObj = json[i];
								var elTr = dtable.insertRow(-1);
								var tkTd = elTr.insertCell(-1);
								var tx = "<span id=\"xh"+i+"\" >" + jydzObj.xh
										+ "</span>";
								tkTd.innerHTML = tx;
								var idTd = elTr.insertCell(-1);
								var sx = "<span id=\"sx"+i+"\" >"
										+ jydzObj.biaot
										+ "</span><input type=\"hidden\" name=\"biaot\" value=\""+jydzObj.biaot+"\"/>";
								idTd.innerHTML = sx;
								var jfTd = elTr.insertCell(-1);
								var jfTd = elTr.insertCell(-1);
								if (ismy == '1') {
									var jfyq = "<textarea cols=\"142\" rows=\"2\" class=\"textarea\" name=\"neir\" readonly >"
											+ jydzObj.neir + "</textarea>";
								} else {
									var jfyq = "<textarea cols=\"142\" rows=\"2\" class=\"textarea\" name=\"neir\" >"
											+ jydzObj.neir + "</textarea>";
								}
								jfTd.innerHTML = jfyq;
							}
						});
	}
	function changeTabForJsdw(vvalue, dwlx) {
		var url = "<s:url value="/"/>/common/changeJsdw?qiyid="+ vvalue+"&qiylx="+dwlx;
		$.get(url, function(data) {
			var json = eval('(' + data + ')');
			//alert(data);
			  $("#bzs").val(json.chumdwjsrdz);
              $("#bfddbr").val(json.chumdwjsrfddbr);
              $("#bwtdlr").val(json.chumdwjsrwtdlr);
              $("#bdh").val(json.chumdwjsrdh);
              $("#bcz").val(json.chumdwjsrcz);
              $("#byb").val(json.chumdwjsryzbm);
              $("#bkhyh").val(json.chumdwjsrkhyh);
              $("#bzh").val(json.chumdwjsrzh);
              $("#bdjh").val(json.chumdwjsrnsrdjh);
              $("#baodjsrmc").val( $("#msdwjsrmc").find("option:selected").text()); 

		});
	}


	function changeTabForYxq(vvalue) {
		
		var cDate = new Date();  
		var cYear=cDate.getFullYear();  
		var yy = cDate.getFullYear(); //截取年，即2016 
		var mm = cDate.getMonth()+1; //截取月，即07 
		var dd = cDate.getDate(); //截取日，即29 
		var clock = yy+'-'; 
		if (mm < 10) clock += '0'; //字符串 
		clock += mm+'-';  
		if (dd < 10) clock += '0';  
		clock += dd; 
		
		for (var i=1;i<13;i++){
	    	if(i<mm){
	    		  $("input[name='gml"+i+"']").toggleClass( "shorttextbox1" ) ;
	    		  $("input[name='gml"+i+"']").attr("readonly","readonly"); 
	    	}}  
		if (vvalue == cYear) {
			$("#nianf").val(vvalue);
			$("#kssj").val(clock);
			$("#jssj").val(vvalue+"-12-31");
			txtzjl_onblur2(mm);
		} else {
			$("#nianf").val(vvalue);
			$("#kssj").val(vvalue+"-01-01");
			$("#jssj").val(vvalue+"-12-31");
			txtzjl_onblur2(1);
		}
	}


	
	function loadCmrData() {
		var url = "<s:url value="/"/>/common/loadCmrForCombox";
		$.get(url, function(data) {
			var json = eval('(' + data + ')');
			$("#cmrbm").empty();
			for ( var i = 0; i < json.length; i++) {
				$("#cmrbm").append(
						"<option value='"+json[i].id+"'>" + json[i].name
								+ "</option>");
			}
		});
	}
	
	 function loadMsrData(){
	        var url = "<s:url value="/"/>/common/";       
	        $.post(url,function(data){
	            var json = eval('(' + data + ')');           
	        $("#msrbm").empty();        
	        $("#msrbm").append("<option value='${jydw.qiydm}'>${jydw.qiyqc}</option>");      
	        for(var i=0;i<json.length;i++){
	        //alert(projects[i].name);
	        $("#msrbm").append("<option value='"+json[i].danwbm+"'>"+json[i].danwmc+"</option>");
	        }
	        });
	    }

	function loadFhdwData() {
		var url = "<s:url value="/"/>/common/loadShdw";
		$.get(url, function(data) {
			var projects = eval('(' + data + ')');
			//alert(data);
			$("#fahdwmc").autocomplete({
				minLength : 2,
				source : projects,
				select : function(event, ui) {
					//alert(ui.item.mingch);	
					$("#fahdwmc").val(ui.item.label);
					//alert(ui.item.value);
					$("#fahdwbm").val(ui.item.value);
					return false;

				}
			});
		});
	}
	
    function ShowMin() {
    	var val=$("input:radio[name='zuixjyfs']:checked").val();
        if(val==0){
        	 $("#zxjs").hide();
    		 $("#zxjs1").hide();
    		 $("#mjds").hide();
    		 $("#zxjyl").show();
    		 $("#zuixjyfs1").attr("checked","checked");
        }else{
        	$("#zxjs").show();
   		 	$("#zxjs1").show();
   		    $("#mjds").show();
   			$("#zxjyl").hide();
   			$("#zuixjyfs2").attr("checked","checked");
        }
    }

	$(function() {
		//clickPzgg();
		loadMsrData();
		//loadCmrData();
		loadFhdwData();
		
		var cDate = new Date();  
		var cYear=cDate.getFullYear();  
		var yYear=cDate.getFullYear()+1;  
		$("#niand").append("<option value='"+cYear+"' selected>"+cYear+"年</option>"); 
		$("#niand").append("<option value='"+yYear+"'>"+yYear+"年</option>"); 
		var yy = cDate.getFullYear(); //截取年，即2006 
		var mm = cDate.getMonth()+1; //截取月，即07 
		var dd = cDate.getDate(); //截取日，即29 
		var clock = yy+'-'; 
		if (mm < 10) clock += '0'; //字符串 
		clock += mm+'-';  
		if (dd < 10) clock += '0';  
		clock += dd; 
		
		var clock1 = yy+'-'+"12-31"; 
		$("#nianf").val(yy);
		$("#kssj").val(clock);
		$("#jssj").val(clock1);
		
    	for (var i=1;i<13;i++){
        	if(i<mm){
        		  $("input[name='gml"+i+"']").toggleClass( "shorttextbox1" ) ;
        		  $("input[name='gml"+i+"']").attr("readonly","readonly"); 
        	}}  
    		
		
		 $("#zxjs").hide();
		 $("#zxjs1").hide();
		 $("#mjds").hide();
		$("#zuixjyfs1").attr("checked","checked");
		
        $("#but1").button();
        $("#but2").button();
        $("#but3").button();
        $("#jsdnr").button();
        $("#jsdnr1").button();
        $("#jsdnr1").hide();
        $( "#datepicker" ).datepicker($.datepicker.regional[ "zh-CN" ]);      
		tj();   
		jsdxxShow();  
		$("#jsdnr1").click(function(){
		jsdxxHide();		
		});
		$("#jsdnr").click(function(){
		jsdxxShow();		
		}); 
		$( document ).tooltip({
		      position: {
		        my: "left top",
		        at: "right top",
		        using: function( position, feedback ) {
		        $( this ).css( position );
		          $( "<div>" )
		            .addClass( "arrow" )
		            .addClass( feedback.vertical )
		            .addClass( feedback.horizontal )
		            .appendTo( this );
		        }
		      }

		    });
	});

	function tj() {
		 $("#fadzmc").val($("#fadzid").find("option:selected").text());
		/**  
		 * 自定义验证规则——增加对select的验证  
		 */
		$.validator.addMethod("selectNone", function(value, element) {
			if (value == "-1") {
				return false;
			} else {
				return true;
			}
		}, "必须选择一项");

		$("#form1").validate({
			rules : {
				 "fahdwmc":"required",
				"pinzgg" : "required",
				"zuixjycj" : "required",
				"zuixjyl" : "required",
				"lis" : {
					selectNone : true
				},
				"jiaosfs" : {
					selectNone : true
				},
				"jiaglx" : {
					selectNone : true
				},
				"fahdwbm":{
				       selectNone:true
				},
				"meityt" : {
					selectNone : true
				},
				"fadzid" : {
					selectNone : true
				},
				"jiesdwid" : {
					selectNone : true
				},
				"baoddw" : {
					selectNone : true
				},
				"lis" : {
					selectNone : true
				},
				"shul" : {
					required : true,
					digits : true,
					range : [ 0, 9999999 ]
				},
				"danj" : {
					required : true,
					number : true,
					range : [ 0, 3000 ]
				}
			},
			messages : {
				"lis" : "请选择隶属行业",
				"jiaosfs" : "请选择交收方式",
				"jiaglx" : "请选择价格类型",
				"meityt" : "请选择煤炭用途",
				"baoddw" : "请选择出卖人",
				"pinzgg" : "请选择品种规格",
				"lis" : "请选择隶属行业",
				"fadzid" : "请选择发站",
				"jiesdwid" : "请选择结算单位",
				"fahdwmc" : "请选择收货单位",
				"zuixjycj" : {
					required : "请输入最小交易车节",
					digits : "请输入整数",
					range : jQuery.validator.format("请输入1和200之间的数")
				},
				"zuixjyl" : {
					required : "请输入最小交易吨数",
					digits : "请输入整数",
					range : jQuery.validator.format("请输入1和100之间的数")
				},
				"shul" : {
					required : "请输入数量",
					digits : "请输入整数",
					range : jQuery.validator.format("请输入一千万吨之内的数")
				},
				"danj" : {
					required : "请输入价格",
					number : "请输入合法数字",
					range : jQuery.validator.format("请输入0和3000之间的数")
				}

			}
		});
		$("#but1")
				.click(
						function() {
							if ($("#form1").valid()) {
								 $("#fadzmc").val($("#fadzid option:selected").text());
								var flag = true;
								var msg = "";

								if(document.getElementById("fahdwbm").value==""){
							           msg ="请选择收货单位";
							           flag =  false;
							        }
								if (parseFloat(document.getElementById("shul").value) != parseFloat(GetYueZJ())) {
									msg = "报单总数量和分月数量不等,请重新填写";
									flag = false;
								}
								
								if(document.getElementById("zlzb").value==""){
							           msg = "请录入质量指标";
							           flag =  false;
							        }	

								if (flag) {
									var url = "<s:url value="/"/>/gpjy/bdlr4mfSave";
									$("#form1").ajaxSubmit({
										url : url,
										type : 'post',
										success : function(data) {
											var json = eval('(' + data + ')');
											if (json.result == 1) {
												alert("保存成功，请【提报】后生效！");
												window.returnValue = 1;
												window.close();
											} else {
												alert("录入失败！");
											}
										}
									});
								} else {
									alert(msg);
								}
							}
						});

	}

	function txtzjl_onblur() { 
	     if ($("#shul").val() != "") {
	    	 var myDate = new Date();
	     	var yf
	    	var yy = myDate.getFullYear(); //截取年，即2006 
		
			
			var nianf=$("#nianf").val();
			if(yy==nianf){
				yf=myDate.getMonth()+1;
			}else{
				yf=1;
			}
             var zjsl = parseFloat($("#shul").val());
             
             var yuesl = zjsl / (12-yf+1);
             var intyue = parseInt(yuesl);
             var syysl = intyue * (11-yf+1);
             var srysl = zjsl - syysl;
             SetYueZJ(intyue, srysl);
             return;
         }
         SetYueZJ(0, 0);  
     }
	function txtzjl_onblur2(yf) { 
	     if ($("#shul").val() != "") {
            var zjsl = parseFloat($("#shul").val());
            
            var yuesl = zjsl / (12-yf+1);
            var intyue = parseInt(yuesl);
            var syysl = intyue * (11-yf+1);
            var srysl = zjsl - syysl;
          
            SetYueZJ(intyue, srysl);
            return;
        }
        SetYueZJ(0, 0);  
    }

     function SetYueZJ(yuesl, srysl) {
         if(yuesl==0){
         $("#shul").val(yuesl)
         }
         var myDate = new Date();
	     var yf;
		var yy = myDate.getFullYear(); //截取年，即2006 
		
			
			var nianf=$("#nianf").val();
		
			if(yy==nianf){
				yf=myDate.getMonth()+1;
			}else{
				yf=1;
			}
     	for (var i=1;i<13;i++)
     	{
     		
     		if(i<yf){
     		
     	      	$("input[name='gml"+i+"']").val(0) ;
     	      	}
     	if(i>=yf){
     	$("input[name='gml"+i+"']").val(yuesl) ;
     	}}           
         $("#dec").val(srysl);            
     } 
      
   function txtyuesl_onblur() {
          if (!event.srcElement.value) {
              event.srcElement.value = '0'
          }
          var temp = GetYueZJ();
          if (isNaN(temp)) {
              $("#shul").val(0);                
          }
          else {
              $("#shul").val(temp);                
          }

      }

      function GetYueZJ() { 
           var yue1 =parseFloat($("#jan").val()==''?0:$("#jan").val());            
          var yue2 = parseFloat($("#feb").val()==''?0:$("#feb").val());
          var yue3 = parseFloat($("#mar").val()==''?0:$("#mar").val());
          var yue4 = parseFloat($("#apr").val()==''?0:$("#apr").val());
          var yue5 = parseFloat($("#may").val()==''?0:$("#may").val());
          var yue6 = parseFloat($("#jun").val()==''?0:$("#jun").val());
          var yue7 = parseFloat($("#jul").val()==''?0:$("#jul").val());
          var yue8 = parseFloat($("#aug").val()==''?0:$("#aug").val());
          var yue9 = parseFloat($("#sep").val()==''?0:$("#sep").val());
          var yue10 = parseFloat($("#oct").val()==''?0:$("#oct").val());
          var yue11 = parseFloat($("#nov").val()==''?0:$("#nov").val());
          var yue12 = parseFloat($("#dec").val()==''?0:$("#dec").val()); 

          var yuezj = yue1 + yue2 + yue3 + yue4 + yue5 + yue6 + yue7 + yue8 + yue9 + yue10 + yue11 + yue12;
          return yuezj;
      }

	function jsdxxHide() {
		$("#jsdnr1").hide();
		$("#jsdnr").show();
		$.each($("#bjsdnr tr"), function(i) {
			if (i > 0) {
				this.style.display = 'none';
			}
		});
		$.each($("#bjsdnr1 tr"), function(i) {
			if (i > 0) {
				this.style.display = 'none';
			}
		});
		$.each($("#sjsdnr tr"), function(i) {
			if (i > 0) {
				this.style.display = 'none';
			}
		});
		$.each($("#sjsdnr1 tr"), function(i) {
			if (i > 0) {
				this.style.display = 'none';
			}
		});
	}

	function jsdxxShow() {
		$("#jsdnr").hide();
		$("#jsdnr1").show();
		$.each($("#bjsdnr tr"), function(i) {
			if (i > 0) {
				this.style.display = 'block';
			}
		});
		$.each($("#sjsdnr tr"), function(i) {
			if (i > 0) {
				this.style.display = 'block';
			}
		});
		$.each($("#bjsdnr1 tr"), function(i) {
			if (i > 0) {
				this.style.display = 'block';
			}
		});
		$.each($("#sjsdnr1 tr"), function(i) {
			if (i > 0) {
				this.style.display = 'block';
			}
		});
	}
</script>

</head>

<body>

	<div id="tab">
		<h1>挂 牌 报 单</h1>

		<form name="form1" id="form1">
			<input type="hidden" id="pinpid" name="pinpid"/>
		<input type="hidden" id="meizmc" name="meizmc"/>
		<input type="hidden" id="pinzmc" name="pinzmc"/>
		<input type="hidden" id="pinp" name="pinp"/>
		<input type="hidden" id="meiz" name="meiz"/>
		<input type="hidden" id="pinz" name="pinz"/>
		<input type="hidden" id="zlzbs" name="zlzbs"/>
		<input type="hidden" id="fadzmc" name="fadzmc"/>
		<input type="hidden" id="fahdwbm"  name="shoufhdwid">
		<input type="hidden" id="baoddw"  name="zhutdwid" value="${msr.maisdwbm}">
		<input type="hidden" id="nianf" name="nianf"/>
		<input type="hidden" id="baodjsrmc"  name="baodjsrmc">
			<table id="list_search" cellpadding="0" cellspacing="0" border="0">
				<tr>
					<td colspan="4"><span
						style="color: red;font-size:12px;margin:0;">[注]:本页面灰色部分为非录入项</span>
					</td>
					<td></td>
					<td></td>

				</tr>
				<tr>
					<td>出卖人（销方）:</td>
					<td><input type="text" style="color:'#C0C0C0'" name=""
						class="longtextbox1" readOnly="true"/>
						
					</td>
					<td>煤炭用途:<span
						style="color: red;font-size:16px;vertical-align:middle;">*</span>
					</td>
					<td>
						<div class="select">
							<div>
								<select name="meityt" style="width:180px" >
									<option value="-1" selected>==请选择==</option>
									<c:forEach var="meyt" items="${meityt}">
										<option value="${meyt.diccode}">${meyt.dicname}</option>
									</c:forEach>
								</select>
							</div>
						</div>
					</td>
					<td><span id="mgz">交收方式:<span
						style="color: red;font-size:16px;vertical-align:middle;">*</span></span>
					</td>
					<td>
						<div class="select">
							<div>
								<select name="jiaosfs" style="width:180px" >
									<option value="-1" selected>==请选择==</option>
									<c:forEach var="jgfs" items="${jiaogfs}">
										<option value="${jgfs.diccode}">${jgfs.dicname}</option>
									</c:forEach>
								</select>
							</div>
						</div>
					</td>
				</tr>

				<tr>
					<td>买受人（购方）:<span
						style="color: red;font-size:16px;vertical-align:middle;">*</span></td>
					<td>
					
						<input  name="msrmc" type="text"
						class="longtextbox" value="${msr.maisdwmc}"  readOnly="true"/> 
					</td>
					<td>价格类型:<span
						style="color: red;font-size:16px;vertical-align:middle;">*</span>
					</td>
					<td>
						<div class="select">
							<div>
								<select name="jiaglx" style="width:180px">
									<option value="-1" selected>==请选择==</option>
									<c:forEach var="jglx" items="${jiaglx}">
										<option value="${jglx.diccode}">${jglx.dicname}</option>
									</c:forEach>
								</select>
							</div>
						</div>
					</td>
					<td>交收地点:</td>
					<td><input id="jiaosdd" name="jiaosdd" type="text"
						class="longtextbox" title="请录入汉字" /> 
					</td>
				</tr>

				<tr>
					<td>发货单位:
					</td>
					<td><input type="text"
						type="text"
						class="longtextbox1" readOnly="true"/> 
					</td>
					<td>隶属行业:<span
						style="color: red;font-size:16px;vertical-align:middle;">*</span>
					</td>
					<td>
						<div class="select">
							<div>
								<select name="lis" style="width:180px">
									<option value="-1" selected>==请选择==</option>
									<c:forEach var="hy" items="${hangy}">
										<option value="${hy.diccode}">${hy.dicname}</option>
									</c:forEach>
								</select>
							</div>
						</div>
					</td>
					<td>产地:
					</td>
					<td><input id="myd" name="yuancd" type="text"
						class="longtextbox" />
					</td>
				</tr>
				
				<tr>
					<td>流向:
					</td>
					<td><input id="" name="liux" type="text" class="longtextbox" title="请录入汉字" /> 
					</td>
					<td>专用线:
					</td>
					<td>
						<input id="" name="zhuanyx" type="text" class="longtextbox" title="请录入汉字" /> 
					</td>
					<td>最少交易方式:<span
						style="color: red;font-size:16px;vertical-align:middle;">*</span>
					</td>
					<td><input type="radio" id="zuixjyfs1" name="zuixjyfs" value="0" onclick="ShowMin();">最少交易量

   						 <input type="radio" id="zuixjyfs2" name="zuixjyfs" value="1" onclick="ShowMin();">最少交易车数
					</td>
				</tr>
				
				<tr>
					<td id="zxjs">最少节数:<span
						style="color: red;font-size:16px;vertical-align:middle;">*</span>
					</td>
					<td id="zxjs1">
						<input id="" name="zuixjycj" type="text"
						class="longtextbox"  /> 
					</td>
					<td id="zxjyl">最少交易量:<span
						style="color: red;font-size:16px;vertical-align:middle;">*</span>
					</td>
					<td  id="mjds">每节吨数:<span
						style="color: red;font-size:16px;vertical-align:middle;">*</span>
					</td>
					<td id="mjds1">
						<input id="" name="zuixjyl" type="text"
						class="longtextbox"/> 
					</td>
				</tr>

				<tr>
					<td colspan="6" style="padding-top:5px;">一、收货人名称、品种规格、交（提）货时间、数量
					</td>
				</tr>
				<tr>
					<td colspan="6" style="padding:1px;">
						<table id="changdi" align="center" cellpadding="0" cellspacing="0"
							class="content_gridview" border="1">
							<thead>
								<tr>
									<th rowspan="3">收货人名称<span
						style="color: red;font-size:16px;vertical-align:middle;">*</span></th>
									<th rowspan="3">发站</th>
									<th rowspan="3">到站<span
						style="color: red;font-size:16px;vertical-align:middle;">*</span></th>
									<th rowspan="3">品种规格<span
										style="color: red;font-size:16px;vertical-align:middle;">*</span>
									</th>
									<th rowspan="3">质量指标<span
										style="color: red;font-size:16px;vertical-align:middle;">*</span></th>
									<th rowspan="3">价格<br />(元/吨)<span
										style="color: red;font-size:16px;vertical-align:middle;">*</span>
									</th>
									<th colspan="13">交（提）货时间、煤量（吨）<span
										style="color: red;font-size:16px;vertical-align:middle;">*</span>
									</th>
								</tr>
								<tr>
									<th rowspan="2">全年合计<span
										style="color: red;font-size:16px;vertical-align:middle;">*</span><br><a
											href="#" onClick="txtzjl_onblur();"
											style="text-decoration:none;cursor: hand"><img
												src="<s:url value="/resources"/>/images/pinf.gif" border=0 alt="平分"
												align="absmiddle" height="18" width="18">
										</a>&nbsp;&nbsp;<a href="#" onClick="SetYueZJ(0,0);"
											style="border:0px;text-decoration:none;cursor: hand"><img
												src="<s:url value="/resources"/>/images/qinl.gif" border=0 alt="清零"
												align="absmiddle" height="18" width="18">
										</a>
									</th>
									<th colspan="3">一季度</th>
									<th colspan="3">二季度</th>
									<th colspan="3">三季度</th>
									<th colspan="3">四季度</th>
								</tr>
								<tr>
									<th>1</th>
									<th>2</th>
									<th>3</th>
									<th>4</th>
									<th>5</th>
									<th>6</th>
									<th>7</th>
									<th>8</th>
									<th>9</th>
									<th>10</th>
									<th>11</th>
									<th>12</th>
								</tr>
							</thead>
							<tbody>
								<tr>
									<td><textarea id="fahdwmc" name="fahdwmc" title="请录入汉字或简拼关键字选择发货单位" cols="15" rows="3"
											class="textarea" ></textarea>
									</td>
									<td><textarea id="shr1" cols="5" rows="3"
											class="textarea1" readonly></textarea>
									</td>
									<td>
									<div class="select">
											<div>
												<select id="fadzid" name="fadzid" style="width:80px">
													<option value="-1" selected>=请选择=</option>
													<c:forEach var="d" items="${daoz}">
														<option value="${d.sysid}">${d.mingch}</option>
													</c:forEach>
												</select>
											</div>
										</div>
									<!-- <div class="select">
											<div>
												<select name="lis" style="width:80px">
													<option value="-1" selected>=请选择=</option>
													<c:forEach var="d" items="${daoz}">
														<option value="${d.sysid}">${d.mingch}</option>
													</c:forEach>
												</select>
											</div>
										</div> -->
									</td>
									<td><textarea  cols="10" rows="3" name="pinzgg" id="pinzgg"
											class="textarea" readonly="readonly" onClick="clickPzgg();"
											title="请鼠标点击后操作"></textarea>
									</td>
									<td><textarea id="zlzb" cols="20" rows="3"
											class="textarea" name="zhilzb" readonly="readonly" onClick="clickPzgg();"></textarea>
									</td>
									<td><input id="jiag" type="text" class="shorttextbox"
										name="danj" title="请输入0和3000之间的数" /></td>
									<td><input id="shul" type="text" class="textboxs"
										name="shul" title="请输入一千万吨之内的数">
									</td>
									<td><input id="jan" type="text" class="shorttextbox"
										name="gml1"
										onkeypress="if( event.keyCode == 13 ) {txtyuesl_onblur();}"
										onKeyUp="this.value=this.value.replace(/\D/g,'');">
									</td>
									<td><input id="feb" type="text" class="shorttextbox"
										name="gml2"
										onkeypress="if( event.keyCode == 13 ) {txtyuesl_onblur();}"
										onKeyUp="this.value=this.value.replace(/\D/g,'');">
									</td>
									<td><input id="mar" type="text" class="shorttextbox"
										name="gml3"
										onkeypress="if( event.keyCode == 13 ) {txtyuesl_onblur();}"
										onKeyUp="this.value=this.value.replace(/\D/g,'');">
									</td>
									<td><input id="apr" type="text" class="shorttextbox"
										name="gml4"
										onkeypress="if( event.keyCode == 13 ) {txtyuesl_onblur();}"
										onKeyUp="this.value=this.value.replace(/\D/g,'');">
									</td>
									<td><input id="may" type="text" class="shorttextbox"
										name="gml5"
										onkeypress="if( event.keyCode == 13 ) {txtyuesl_onblur();}"
										onKeyUp="this.value=this.value.replace(/\D/g,'');">
									</td>
									<td><input id="jun" type="text" class="shorttextbox"
										name="gml6"
										onkeypress="if( event.keyCode == 13 ) {txtyuesl_onblur();}"
										onKeyUp="this.value=this.value.replace(/\D/g,'');">
									</td>
									<td><input id="jul" type="text" class="shorttextbox"
										name="gml7"
										onkeypress="if( event.keyCode == 13 ) {txtyuesl_onblur();}"
										onKeyUp="this.value=this.value.replace(/\D/g,'');">
									</td>
									<td><input id="aug" type="text" class="shorttextbox"
										name="gml8"
										onkeypress="if( event.keyCode == 13 ) {txtyuesl_onblur();}"
										onKeyUp="this.value=this.value.replace(/\D/g,'');">
									</td>
									<td><input id="sep" type="text" class="shorttextbox"
										name="gml9"
										onkeypress="if( event.keyCode == 13 ) {txtyuesl_onblur();}"
										onKeyUp="this.value=this.value.replace(/\D/g,'');">
									</td>
									<td><input id="oct" type="text" class="shorttextbox"
										name="gml10"
										onkeypress="if( event.keyCode == 13 ) {txtyuesl_onblur();}"
										onKeyUp="this.value=this.value.replace(/\D/g,'');">
									</td>
									<td><input id="nov" type="text" class="shorttextbox"
										name="gml11"
										onkeypress="if( event.keyCode == 13 ) {txtyuesl_onblur();}"
										onKeyUp="this.value=this.value.replace(/\D/g,'');">
									</td>
									<td><input id="dec" type="text" class="shorttextbox"
										name="gml12"
										onkeypress="if( event.keyCode == 13 ) {txtyuesl_onblur();}"
										onKeyUp="this.value=this.value.replace(/\D/g,'');">
									</td>
								</tr>
							</tbody>
						</table>
					</td>
				</tr>
			
				<tr>
					<td>备注:</td>
					<td>
						<input id="" name="beiz" type="text"
						class="longtextbox" title="请录入汉字" /> 
					</td>
					
				</tr>
				<tr>

					<td>条款模板:</td>
					<td colspan="5">
						<div class="select">
							<div>
								<select name="tkbm" style="width:180px"
									onchange="changeTabForHttk(this.value)">
									<c:forEach var="httkmc" items="${httkmc}">
										<option value="${httkmc.id}">${httkmc.name}</option>
									</c:forEach>
								</select>
							</div>
						</div>
					</td>
				</tr>
				<tr>
					<td colspan="6">
						<table id="httk" cellpadding="0" cellspacing="0" border="0"
							class="content1">
							<c:forEach var="tk" items="${mrhttk}">
								<tr>
									<td width="400px">${tk.xh}${tk.biaot}</td>
									<td><textarea cols="142" rows="2" class="textarea" name="neir">${tk.neir}</textarea>
									</td>
								</tr>
							</c:forEach>
						</table>
					</td>
				</tr>
				<tr>
					<td colspan="6">
						<table cellpadding="0" cellspacing="0" style="width:100%"
							class="content_gridview" border="1">
							<thead>
								<tr>
									<th colspan="2">出卖人(销方)</th>
									<th colspan="2">买受人（购方）</th>
								</tr>
							</thead>
							<tbody>
								<tr>
									<td>
										<table id="sjsdnr" cellpadding="0" cellspacing="0" border="0"
											class="content1">
											<tr>
												<td>出卖人名称：</td>
												<td><input type="text" class="longtextbox1" id="qiymc"
													value=""  readonly/></td>
											</tr>

											<tr>
												<td>住 所:</td>
												<td><input id="chumdwdz" type="text"
													class="longtextbox1" value="" readonly/></td>
											</tr>
											<tr>
												<td>法定代表人:</td>
												<td><input id="chumdwfddbr" type="text"
													class="longtextbox1" value="" readonly/></td>
											</tr>
											<tr>
												<td>委托代理人:</td>
												<td><input id="chumdwwtdlr" type="text"
													class="longtextbox1" readonly /></td>
											</tr>
											<tr>
												<td>电 话:</td>
												<td><input id="chumdwdh" type="text"
													class="longtextbox1" readonly/></td>
											</tr>
											<tr>
												<td>传真:</td>
												<td><input id="chumdwcz" type="text"
													class="longtextbox1" readonly/></td>
											</tr>
											<tr>
												<td>邮政编码:</td>
												<td><input id="chumdwyzbm" type="text"
													class="longtextbox1" readonly /></td>
											</tr>
											<tr>
												<td>开户银行:</td>
												<td><input id="chumdwkhyh" type="text"
													class="longtextbox1" readonly /></td>
											</tr>
											<tr>
												<td>帐号:</td>
												<td><input id="chumdwzh" type="text"
													class="longtextbox1" readonly /></td>
											</tr>
											<tr>
												<td>纳税人登记号:</td>
												<td><input id="chumdwnsrdjh" type="text"
													class="longtextbox1" readonly /></td>
											</tr>
											
										</table></td>
									<td><table id="sjsdnr1" cellpadding="0" cellspacing="0"
											border="0" class="content1">
											<tr>
												<td>出卖人结算单位名称：
												</td>
												<td>
												<input  type="text"
													class="longtextbox1"  readonly/>
												</td>
											</tr>

											<tr>
												<td>住 所:</td>
												<td><input id="szs" type="text" class="longtextbox1"
													readonly />
												</td>
											</tr>
											<tr>
												<td>法定代表人:</td>
												<td><input id="sfddbr" type="text" class="longtextbox1"
													readonly />
												</td>
											</tr>
											<tr>
												<td>委托代理人:</td>
												<td><input id="swtdlr" type="text" class="longtextbox1"
													readonly />
												</td>
											</tr>
											<tr>
												<td>电 话:</td>
												<td><input id="sdh" type="text" class="longtextbox1"
													readonly />
												</td>
											</tr>
											<tr>
												<td>传真:</td>
												<td><input id="scz" type="text" class="longtextbox1"
													readonly />
												</td>
											</tr>
											<tr>
												<td>邮政编码:</td>
												<td><input id="syb" type="text" class="longtextbox1"
													readonly />
												</td>
											</tr>
											<tr>
												<td>开户银行:</td>
												<td><input id="skhyh" type="text" class="longtextbox1"
													readonly />
												</td>
											</tr>
											<tr>
												<td>帐号:</td>
												<td><input id="szh" type="text" class="longtextbox1"
													readonly />
												</td>
											</tr>
											<tr>
												<td>纳税人登记号:</td>
												<td><input id="sdjh" type="text" class="longtextbox1"
													readonly />
												</td>
											</tr>

										</table></td>
									<td><table id="bjsdnr" cellpadding="0" cellspacing="0"
											border="0" class="content1">
											<tr>
												<td>买受人名称：</td>
												<td><input id="maisr" type="text" class="longtextbox" value="${msr.maisdwmc}"
													 name="baodrmc"/>
												</td>
											</tr>

											<tr>
												<td>住 所:</td>
												<td><input id="zs" type="text" class="longtextbox" value="${msr.maisdwdz}"
													 name="baodrzs"/>
												</td>
											</tr>
											<tr>
												<td>法定代表人:</td>
												<td><input id="fddbr" type="text" class="longtextbox" value="${msr.maisdwfddbr}"
													 name="baodrfddbr"/>
												</td>
											</tr>
											<tr>
												<td>委托代理人:</td>
												<td><input id="wtdlr" type="text" class="longtextbox" value="${msr.maisdwwtdlr}"
													 name="baodrwtdlr"/>
												</td>
											</tr>
											<tr>
												<td>电 话:</td>
												<td><input id="dh" type="text" class="longtextbox" value="${msr.maisdwdh}"
													 name="baodrdh"/>
												</td>
											</tr>
											<tr>
												<td>传真:</td>
												<td><input id="cz" type="text" class="longtextbox" value="${msr.maisdwcz}"
													 name="baodrcz"/>
												</td>
											</tr>
											<tr>
												<td>邮政编码:</td>
												<td><input id="yb" type="text" class="longtextbox" value="${msr.maisdwyzbm}"
													 name="baodryzbm"/>
												</td>
											</tr>
											<tr>
												<td>开户银行:</td>
												<td><input id="khyh" type="text" class="longtextbox" value="${msr.maisdwkhyh}"
													 name="baodrkhyh"/>
												</td>
											</tr>
											<tr>
												<td>帐号:</td>
												<td><input id="zh" type="text" class="longtextbox" value="${msr.maisdwzh}"
													 name="baodryhzh"/>
												</td>
											</tr>
											<tr>
												<td>纳税人登记号:</td>
												<td><input id="djh" type="text" class="longtextbox" value="${msr.maisdwnsrdjh}"
													 name="baodrnsrdjzh"/>
												</td>
											</tr>

										</table></td>
									<td><table id="bjsdnr1" cellpadding="0" cellspacing="0"
											border="0" class="content1">
											<tr>
												<td>买受人结算单位名称：<span
													style="color: red;font-size:16px;vertical-align:middle;">*</span></td>
												<td>
													<div class="select">
														<div><select id="msdwjsrmc" name="jiesdwid" style="width:180px" onchange="changeTabForJsdw(this.value,'1')">
													<option value="-1" selected>=请选择=</option>
													<c:forEach var="jsdw" items="${jsdw}">
														<option value="${jsdw.sysid}">${jsdw.mingch}</option>
													</c:forEach>
												</select></div>
													</div>
												</td>
											</tr>

											<tr>
												<td>住 所:</td>
												<td><input id="bzs" type="text" class="longtextbox"
													 name="baodjsrzs"/>
												</td>
											</tr>
											<tr>
												<td>法定代表人:</td>
												<td><input id="bfddbr" type="text" class="longtextbox"
													 name="baodjsrfddbr"/>
												</td>
											</tr>
											<tr>
												<td>委托代理人:</td>
												<td><input id="bwtdlr" type="text" class="longtextbox"
													 name="baodjsrwtdlr"/>
												</td>
											</tr>
											<tr>
												<td>电 话:</td>
												<td><input id="bdh" type="text" class="longtextbox"
													 name="baodjsrdh"/>
												</td>
											</tr>
											<tr>
												<td>传真:</td>
												<td><input id="bcz" type="text" class="longtextbox"
													 name="baodjsrcz"/>
												</td>
											</tr>
											<tr>
												<td>邮政编码:</td>
												<td><input id="byb" type="text" class="longtextbox"
													 name="baodjsryzbm"/>
												</td>
											</tr>
											<tr>
												<td>开户银行:</td>
												<td><input id="bkhyh" type="text" class="longtextbox"
													 name="baodjsrkhyh"/>
												</td>
											</tr>
											<tr>
												<td>帐号:</td>
												<td><input id="bzh" type="text" class="longtextbox"
													 name="baodjsryhzh"/>
												</td>
											</tr>
											<tr>
												<td>纳税人登记号:</td>
												<td><input id="bdjh" type="text" class="longtextbox"
													 name="baodjsrnsrdjzh"/>
												</td>
											</tr>

										</table></td>
								</tr>
							</tbody>
						</table>
					</td>

				</tr>
				<tr>
					<td colspan="4"><font size="2" color="#FF0000"><br>
					</font></td>
					<td align="right"><font size="2">年度：</font>
					</td>
							<td style="text-align:right">
						<div class="select">
							<div>
								<select style="width:70px;"
									onChange="changeTabForYxq(this.value)" id="niand" name="niand">
									
								</select>
							</div>
						</div> <font size="2">有效期：</font> <input id="kssj" type="text"
						name="hetksrq" class="textbox"  readonly /> 至
						<input id="jssj" type="text" class="textbox" name="hetjsrq" readonly />
					</td>
				</tr>
				<tr>
					<td colspan="6" align="center"><input type="button"
						id="jsdnr1" value="隐藏"> <input type="button" id="jsdnr"
							value="展开">&nbsp;&nbsp;&nbsp; <input id="but1"
								type="button" value="保存" /> &nbsp;&nbsp;&nbsp;<input id="but3"
								type="button" name="" value="关闭"
								onClick="window.returnValue=1;window.close();" />
					</td>
				</tr>
			</table>
			
		</form>
	</div>

</body>
</html>

